feat(notes-list): add sort toggle and improve grouping - #1928
Open
MiMoHo wants to merge 3 commits into
Open
Conversation
The notes list skipped the caption row whenever all notes fell into a single group. Fresh accounts whose notes were all created today never saw the Today heading. Render groups uniformly so captions appear from the first note on. Assisted-by: Claude Code:claude-fable-5 AI-assistant: Claude Code 2.1.187 (Claude Fable 5) Signed-off-by: MiMoHo <37556964+MiMoHo@users.noreply.github.com>
Categories were always grouped by subcategory, so a category without subcategories showed a plain alphabetical list without any headings. Sort and group such categories by timeslot, the same way as All notes. Categories containing subcategories keep the subcategory grouping. Assisted-by: Claude Code:claude-fable-5 AI-assistant: Claude Code 2.1.187 (Claude Fable 5) Signed-off-by: MiMoHo <37556964+MiMoHo@users.noreply.github.com>
Add a sort menu next to the search field that switches the notes list between modification date (newest first, the previous behavior) and alphabetical order. The choice is stored as the user setting sortMode. Alphabetical order shows a single flat list, since time or category captions would not match the ordering. Assisted-by: Claude Code:claude-fable-5 AI-assistant: Claude Code 2.1.187 (Claude Fable 5) Signed-off-by: MiMoHo <37556964+MiMoHo@users.noreply.github.com>
MiMoHo
force-pushed
the
feat/notes-list-ordering
branch
from
July 6, 2026 16:11
72e57da to
e80edb9
Compare
karlitschek
requested review from
max-nextcloud and
mejo-
and
a lite review from Copilot
August 6, 2026 12:15
There was a problem hiding this comment.
Pull request overview
Enhances the notes list UX by adding a persisted sort toggle and making grouping behavior more consistent across “All notes” and category views, including showing time captions even for a single group.
Changes:
- Add a sort mode setting (
modifiedvstitle) and UI toggle next to search. - Adjust grouping logic to show time captions even when there’s only one group, and to time-group “flat” categories similarly to “All notes”.
- Add backend validation for the new
sortModeuser setting.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/store/notes.js | Adds sort-mode aware ordering and “flat category” detection to drive recent vs category sorting. |
| src/components/NotesView.vue | Adds sort menu UI, updates grouping logic, and removes the single-group caption suppression path. |
| lib/Service/SettingsService.php | Registers and validates the new sortMode setting values. |
Suppressed comments (1)
src/components/NotesView.vue:56
- The two caption components use raw
group.category/group.timeslotas keys. Since category names are user-controlled, they can collide with timeslot labels (e.g., a category named "Today"), causing duplicate keys and incorrect vnode reuse.
:key="group.category"
:name="categoryToLabel(group.category)"
/>
<NotesCaption v-if="group.timeslot"
:key="group.timeslot"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+140
to
+142
| const flatCategory = state.selectedCategory !== null | ||
| && notes.every(note => note.category === state.selectedCategory) | ||
| notes.sort(state.selectedCategory === null || flatCategory ? cmpRecent : cmpCategory) |
Comment on lines
+175
to
+178
| // time grouping applies to "All notes" and to categories without subcategories | ||
| groupByTime() { | ||
| return this.category === null || this.filteredNotes.every(note => note.category === this.category) | ||
| }, |
Comment on lines
+26
to
+29
| <NcActions class="sort-menu" | ||
| :aria-label="t('notes', 'Sort notes')" | ||
| :force-menu="true" | ||
| > |
Comment on lines
+50
to
53
| <template v-for="(group, idx) in groupedNotes"> | ||
| <NotesCaption v-if="group.category && category!==group.category" | ||
| :key="group.category" | ||
| :name="categoryToLabel(group.category)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three closely related improvements to how the notes list is grouped and ordered:
sortModesetting. Alphabetical order renders a single flat list, since time or category captions would contradict the ordering.Fixes #613
Testing
Automated browser tests (Playwright) on Chromium and WebKit:
Screenshot of the sort menu in alphabetical mode is attached:
🤖 AI (if applicable)
I reviewed and tested the changes myself.